package com.eascs.web.o2o.web.sso;

import javax.inject.Inject;

import org.springframework.stereotype.Repository;

import com.eascs.app.dao.JdbcSession;
import com.eascs.web.sso.User;

@Repository
public class EaSsoDao {
	@Inject
	private JdbcSession jdbcSessionOracle;

	public <T extends User> T getUserByAccount(String loginName, Class<T> type) {
		String sql = "select h.EMPLOYEENO as no,h.EMPLOYEECODE as code,h.EMPLOYEENAMECN as cname,h.EMAIL as email,h.MOBILE as mobile,h.EMPLOYEEACCOUNT as account,h.OPERATIONDEPT as org from eadb.HR_EMPLOYEE h where h.EMPLOYEEACCOUNT = ?";
		return this.jdbcSessionOracle.findEntity(sql, type, loginName);
	}
}
